<template>
  <div class="right-chart-1">
      <dv-scroll-ranking-board :config="ordersProvinceCount" class="scroll-board"/>
  </div>
</template>

<script>
import { getOrdersCountByProvince } from "../../../Api/leadership/logistics";
export default {
  name: "RightChart1",
  data() {
    return {
      ordersProvinceCount: {
        data: [],
        unit: "件",
        rowNum:6
      },
    };
  },
  methods: {
    async setOrdersProvinceCount() {
      const { data: res } = await getOrdersCountByProvince();
      if (res.statusCode !== 20000) {
        console.error(res.message);
      } else {
        this.ordersProvinceCount.data = res.data.map((item) => ({
          name: item.province,
          value: Number(item.count),
        }));
        this.ordersProvinceCount = { ...this.ordersProvinceCount };
      }
    },
  },
  created() {
    this.setOrdersProvinceCount();
  },
};
</script>

<style lang="scss" scoped>
.right-chart-1 {
  height: 100%;
  width: 100%;
  .scroll-board{
    // height: 75%;
    height: 360px;
    width: 80%;
    padding-top: 55px;
    margin: auto;
  }
}
</style>
